3.74 \(\int \frac{(d+i c d x) (a+b \tan ^{-1}(c x))^2}{x^3} \, dx\)

Optimal. Leaf size=159 \[ b^2 c^2 d \text{PolyLog}\left (2,-1+\frac{2}{1-i c x}\right )+\frac{1}{2} c^2 d \left (a+b \tan ^{-1}(c x)\right )^2+2 i b c^2 d \log \left (2-\frac{2}{1-i c x}\right ) \left (a+b \tan ^{-1}(c x)\right )-\frac{d \left (a+b \tan ^{-1}(c x)\right )^2}{2 x^2}-\frac{i c d \left (a+b \tan ^{-1}(c x)\right )^2}{x}-\frac{b c d \left (a+b \tan ^{-1}(c x)\right )}{x}-\frac{1}{2} b^2 c^2 d \log \left (c^2 x^2+1\right )+b^2 c^2 d \log (x) \]

[Out]

-((b*c*d*(a + b*ArcTan[c*x]))/x) + (c^2*d*(a + b*ArcTan[c*x])^2)/2 - (d*(a + b*ArcTan[c*x])^2)/(2*x^2) - (I*c*
d*(a + b*ArcTan[c*x])^2)/x + b^2*c^2*d*Log[x] - (b^2*c^2*d*Log[1 + c^2*x^2])/2 + (2*I)*b*c^2*d*(a + b*ArcTan[c
*x])*Log[2 - 2/(1 - I*c*x)] + b^2*c^2*d*PolyLog[2, -1 + 2/(1 - I*c*x)]

________________________________________________________________________________________

Rubi [A]  time = 0.339214, antiderivative size = 159, normalized size of antiderivative = 1., number of steps used = 14, number of rules used = 11, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.478, Rules used = {4876, 4852, 4918, 266, 36, 29, 31, 4884, 4924, 4868, 2447} \[ b^2 c^2 d \text{PolyLog}\left (2,-1+\frac{2}{1-i c x}\right )+\frac{1}{2} c^2 d \left (a+b \tan ^{-1}(c x)\right )^2+2 i b c^2 d \log \left (2-\frac{2}{1-i c x}\right ) \left (a+b \tan ^{-1}(c x)\right )-\frac{d \left (a+b \tan ^{-1}(c x)\right )^2}{2 x^2}-\frac{i c d \left (a+b \tan ^{-1}(c x)\right )^2}{x}-\frac{b c d \left (a+b \tan ^{-1}(c x)\right )}{x}-\frac{1}{2} b^2 c^2 d \log \left (c^2 x^2+1\right )+b^2 c^2 d \log (x) \]

Antiderivative was successfully verified.

[In]

Int[((d + I*c*d*x)*(a + b*ArcTan[c*x])^2)/x^3,x]

[Out]

-((b*c*d*(a + b*ArcTan[c*x]))/x) + (c^2*d*(a + b*ArcTan[c*x])^2)/2 - (d*(a + b*ArcTan[c*x])^2)/(2*x^2) - (I*c*
d*(a + b*ArcTan[c*x])^2)/x + b^2*c^2*d*Log[x] - (b^2*c^2*d*Log[1 + c^2*x^2])/2 + (2*I)*b*c^2*d*(a + b*ArcTan[c
*x])*Log[2 - 2/(1 - I*c*x)] + b^2*c^2*d*PolyLog[2, -1 + 2/(1 - I*c*x)]

Rule 4876

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_))^(q_.), x_Symbol] :> Int[Ex
pandIntegrand[(a + b*ArcTan[c*x])^p, (f*x)^m*(d + e*x)^q, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[p,
 0] && IntegerQ[q] && (GtQ[q, 0] || NeQ[a, 0] || IntegerQ[m])

Rule 4852

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*ArcTa
n[c*x])^p)/(d*(m + 1)), x] - Dist[(b*c*p)/(d*(m + 1)), Int[((d*x)^(m + 1)*(a + b*ArcTan[c*x])^(p - 1))/(1 + c^
2*x^2), x], x] /; FreeQ[{a, b, c, d, m}, x] && IGtQ[p, 0] && (EqQ[p, 1] || IntegerQ[m]) && NeQ[m, -1]

Rule 4918

Int[(((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Dist[1/d,
 Int[(f*x)^m*(a + b*ArcTan[c*x])^p, x], x] - Dist[e/(d*f^2), Int[((f*x)^(m + 2)*(a + b*ArcTan[c*x])^p)/(d + e*
x^2), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && GtQ[p, 0] && LtQ[m, -1]

Rule 266

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 4884

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(a + b*ArcTan[c*x])^(p +
 1)/(b*c*d*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[e, c^2*d] && NeQ[p, -1]

Rule 4924

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((x_)*((d_) + (e_.)*(x_)^2)), x_Symbol] :> -Simp[(I*(a + b*ArcTan
[c*x])^(p + 1))/(b*d*(p + 1)), x] + Dist[I/d, Int[(a + b*ArcTan[c*x])^p/(x*(I + c*x)), x], x] /; FreeQ[{a, b,
c, d, e}, x] && EqQ[e, c^2*d] && GtQ[p, 0]

Rule 4868

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((x_)*((d_) + (e_.)*(x_))), x_Symbol] :> Simp[((a + b*ArcTan[c*x]
)^p*Log[2 - 2/(1 + (e*x)/d)])/d, x] - Dist[(b*c*p)/d, Int[((a + b*ArcTan[c*x])^(p - 1)*Log[2 - 2/(1 + (e*x)/d)
])/(1 + c^2*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 0] && EqQ[c^2*d^2 + e^2, 0]

Rule 2447

Int[Log[u_]*(Pq_)^(m_.), x_Symbol] :> With[{C = FullSimplify[(Pq^m*(1 - u))/D[u, x]]}, Simp[C*PolyLog[2, 1 - u
], x] /; FreeQ[C, x]] /; IntegerQ[m] && PolyQ[Pq, x] && RationalFunctionQ[u, x] && LeQ[RationalFunctionExponen
ts[u, x][[2]], Expon[Pq, x]]

Rubi steps

\begin{align*} \int \frac{(d+i c d x) \left (a+b \tan ^{-1}(c x)\right )^2}{x^3} \, dx &=\int \left (\frac{d \left (a+b \tan ^{-1}(c x)\right )^2}{x^3}+\frac{i c d \left (a+b \tan ^{-1}(c x)\right )^2}{x^2}\right ) \, dx\\ &=d \int \frac{\left (a+b \tan ^{-1}(c x)\right )^2}{x^3} \, dx+(i c d) \int \frac{\left (a+b \tan ^{-1}(c x)\right )^2}{x^2} \, dx\\ &=-\frac{d \left (a+b \tan ^{-1}(c x)\right )^2}{2 x^2}-\frac{i c d \left (a+b \tan ^{-1}(c x)\right )^2}{x}+(b c d) \int \frac{a+b \tan ^{-1}(c x)}{x^2 \left (1+c^2 x^2\right )} \, dx+\left (2 i b c^2 d\right ) \int \frac{a+b \tan ^{-1}(c x)}{x \left (1+c^2 x^2\right )} \, dx\\ &=c^2 d \left (a+b \tan ^{-1}(c x)\right )^2-\frac{d \left (a+b \tan ^{-1}(c x)\right )^2}{2 x^2}-\frac{i c d \left (a+b \tan ^{-1}(c x)\right )^2}{x}+(b c d) \int \frac{a+b \tan ^{-1}(c x)}{x^2} \, dx-\left (2 b c^2 d\right ) \int \frac{a+b \tan ^{-1}(c x)}{x (i+c x)} \, dx-\left (b c^3 d\right ) \int \frac{a+b \tan ^{-1}(c x)}{1+c^2 x^2} \, dx\\ &=-\frac{b c d \left (a+b \tan ^{-1}(c x)\right )}{x}+\frac{1}{2} c^2 d \left (a+b \tan ^{-1}(c x)\right )^2-\frac{d \left (a+b \tan ^{-1}(c x)\right )^2}{2 x^2}-\frac{i c d \left (a+b \tan ^{-1}(c x)\right )^2}{x}+2 i b c^2 d \left (a+b \tan ^{-1}(c x)\right ) \log \left (2-\frac{2}{1-i c x}\right )+\left (b^2 c^2 d\right ) \int \frac{1}{x \left (1+c^2 x^2\right )} \, dx-\left (2 i b^2 c^3 d\right ) \int \frac{\log \left (2-\frac{2}{1-i c x}\right )}{1+c^2 x^2} \, dx\\ &=-\frac{b c d \left (a+b \tan ^{-1}(c x)\right )}{x}+\frac{1}{2} c^2 d \left (a+b \tan ^{-1}(c x)\right )^2-\frac{d \left (a+b \tan ^{-1}(c x)\right )^2}{2 x^2}-\frac{i c d \left (a+b \tan ^{-1}(c x)\right )^2}{x}+2 i b c^2 d \left (a+b \tan ^{-1}(c x)\right ) \log \left (2-\frac{2}{1-i c x}\right )+b^2 c^2 d \text{Li}_2\left (-1+\frac{2}{1-i c x}\right )+\frac{1}{2} \left (b^2 c^2 d\right ) \operatorname{Subst}\left (\int \frac{1}{x \left (1+c^2 x\right )} \, dx,x,x^2\right )\\ &=-\frac{b c d \left (a+b \tan ^{-1}(c x)\right )}{x}+\frac{1}{2} c^2 d \left (a+b \tan ^{-1}(c x)\right )^2-\frac{d \left (a+b \tan ^{-1}(c x)\right )^2}{2 x^2}-\frac{i c d \left (a+b \tan ^{-1}(c x)\right )^2}{x}+2 i b c^2 d \left (a+b \tan ^{-1}(c x)\right ) \log \left (2-\frac{2}{1-i c x}\right )+b^2 c^2 d \text{Li}_2\left (-1+\frac{2}{1-i c x}\right )+\frac{1}{2} \left (b^2 c^2 d\right ) \operatorname{Subst}\left (\int \frac{1}{x} \, dx,x,x^2\right )-\frac{1}{2} \left (b^2 c^4 d\right ) \operatorname{Subst}\left (\int \frac{1}{1+c^2 x} \, dx,x,x^2\right )\\ &=-\frac{b c d \left (a+b \tan ^{-1}(c x)\right )}{x}+\frac{1}{2} c^2 d \left (a+b \tan ^{-1}(c x)\right )^2-\frac{d \left (a+b \tan ^{-1}(c x)\right )^2}{2 x^2}-\frac{i c d \left (a+b \tan ^{-1}(c x)\right )^2}{x}+b^2 c^2 d \log (x)-\frac{1}{2} b^2 c^2 d \log \left (1+c^2 x^2\right )+2 i b c^2 d \left (a+b \tan ^{-1}(c x)\right ) \log \left (2-\frac{2}{1-i c x}\right )+b^2 c^2 d \text{Li}_2\left (-1+\frac{2}{1-i c x}\right )\\ \end{align*}

Mathematica [A]  time = 0.274071, size = 190, normalized size = 1.19 \[ -\frac{d \left (-2 b^2 c^2 x^2 \text{PolyLog}\left (2,e^{2 i \tan ^{-1}(c x)}\right )+2 i a^2 c x+a^2-4 i a b c^2 x^2 \log (c x)+2 i a b c^2 x^2 \log \left (c^2 x^2+1\right )+2 b \tan ^{-1}(c x) \left (a c^2 x^2+2 i a c x+a-2 i b c^2 x^2 \log \left (1-e^{2 i \tan ^{-1}(c x)}\right )+b c x\right )+2 a b c x-2 b^2 c^2 x^2 \log \left (\frac{c x}{\sqrt{c^2 x^2+1}}\right )-b^2 (c x-i)^2 \tan ^{-1}(c x)^2\right )}{2 x^2} \]

Warning: Unable to verify antiderivative.

[In]

Integrate[((d + I*c*d*x)*(a + b*ArcTan[c*x])^2)/x^3,x]

[Out]

-(d*(a^2 + (2*I)*a^2*c*x + 2*a*b*c*x - b^2*(-I + c*x)^2*ArcTan[c*x]^2 + 2*b*ArcTan[c*x]*(a + (2*I)*a*c*x + b*c
*x + a*c^2*x^2 - (2*I)*b*c^2*x^2*Log[1 - E^((2*I)*ArcTan[c*x])]) - (4*I)*a*b*c^2*x^2*Log[c*x] - 2*b^2*c^2*x^2*
Log[(c*x)/Sqrt[1 + c^2*x^2]] + (2*I)*a*b*c^2*x^2*Log[1 + c^2*x^2] - 2*b^2*c^2*x^2*PolyLog[2, E^((2*I)*ArcTan[c
*x])]))/(2*x^2)

________________________________________________________________________________________

Maple [B]  time = 0.107, size = 487, normalized size = 3.1 \begin{align*} -{\frac{{b}^{2}{c}^{2}d\ln \left ({c}^{2}{x}^{2}+1 \right ) }{2}}-{c}^{2}d{b}^{2}{\it dilog} \left ( 1+icx \right ) +{c}^{2}d{b}^{2}{\it dilog} \left ( 1-icx \right ) -{\frac{{c}^{2}d{b}^{2} \left ( \arctan \left ( cx \right ) \right ) ^{2}}{2}}-{\frac{{c}^{2}d{b}^{2} \left ( \ln \left ( cx-i \right ) \right ) ^{2}}{4}}-{\frac{{c}^{2}d{b}^{2}{\it dilog} \left ( -{\frac{i}{2}} \left ( cx+i \right ) \right ) }{2}}+{\frac{{c}^{2}d{b}^{2} \left ( \ln \left ( cx+i \right ) \right ) ^{2}}{4}}+{\frac{{c}^{2}d{b}^{2}{\it dilog} \left ({\frac{i}{2}} \left ( cx-i \right ) \right ) }{2}}+{c}^{2}d{b}^{2}\ln \left ( cx \right ) -{\frac{d{b}^{2} \left ( \arctan \left ( cx \right ) \right ) ^{2}}{2\,{x}^{2}}}-{\frac{2\,idcab\arctan \left ( cx \right ) }{x}}-{\frac{idc{b}^{2} \left ( \arctan \left ( cx \right ) \right ) ^{2}}{x}}+2\,i{c}^{2}d{b}^{2}\arctan \left ( cx \right ) \ln \left ( cx \right ) +2\,i{c}^{2}dab\ln \left ( cx \right ) -i{c}^{2}dab\ln \left ({c}^{2}{x}^{2}+1 \right ) -i{c}^{2}d{b}^{2}\arctan \left ( cx \right ) \ln \left ({c}^{2}{x}^{2}+1 \right ) -{\frac{dab\arctan \left ( cx \right ) }{{x}^{2}}}-{\frac{idc{a}^{2}}{x}}-{\frac{dcab}{x}}-{c}^{2}d{b}^{2}\ln \left ( cx \right ) \ln \left ( 1+icx \right ) +{c}^{2}d{b}^{2}\ln \left ( cx \right ) \ln \left ( 1-icx \right ) +{\frac{{c}^{2}d{b}^{2}\ln \left ( cx-i \right ) \ln \left ({c}^{2}{x}^{2}+1 \right ) }{2}}+{\frac{{c}^{2}d{b}^{2}\ln \left ( cx+i \right ) \ln \left ({\frac{i}{2}} \left ( cx-i \right ) \right ) }{2}}-{\frac{{c}^{2}d{b}^{2}\ln \left ( cx-i \right ) \ln \left ( -{\frac{i}{2}} \left ( cx+i \right ) \right ) }{2}}-{c}^{2}dab\arctan \left ( cx \right ) -{\frac{dc{b}^{2}\arctan \left ( cx \right ) }{x}}-{\frac{{c}^{2}d{b}^{2}\ln \left ( cx+i \right ) \ln \left ({c}^{2}{x}^{2}+1 \right ) }{2}}-{\frac{d{a}^{2}}{2\,{x}^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d+I*c*d*x)*(a+b*arctan(c*x))^2/x^3,x)

[Out]

-1/2*b^2*c^2*d*ln(c^2*x^2+1)-c^2*d*b^2*dilog(1+I*c*x)+c^2*d*b^2*dilog(1-I*c*x)-1/2*c^2*d*b^2*arctan(c*x)^2-1/4
*c^2*d*b^2*ln(c*x-I)^2-1/2*c^2*d*b^2*dilog(-1/2*I*(c*x+I))+1/4*c^2*d*b^2*ln(c*x+I)^2+1/2*c^2*d*b^2*dilog(1/2*I
*(c*x-I))+c^2*d*b^2*ln(c*x)-1/2*d*b^2*arctan(c*x)^2/x^2-2*I*c*d*a*b*arctan(c*x)/x-I*c*d*b^2*arctan(c*x)^2/x+2*
I*c^2*d*b^2*arctan(c*x)*ln(c*x)+2*I*c^2*d*a*b*ln(c*x)-I*c^2*d*a*b*ln(c^2*x^2+1)-I*c^2*d*b^2*arctan(c*x)*ln(c^2
*x^2+1)-d*a*b*arctan(c*x)/x^2-I*c*d*a^2/x-c*d*a*b/x-c^2*d*b^2*ln(c*x)*ln(1+I*c*x)+c^2*d*b^2*ln(c*x)*ln(1-I*c*x
)+1/2*c^2*d*b^2*ln(c*x-I)*ln(c^2*x^2+1)+1/2*c^2*d*b^2*ln(c*x+I)*ln(1/2*I*(c*x-I))-1/2*c^2*d*b^2*ln(c*x-I)*ln(-
1/2*I*(c*x+I))-c^2*d*a*b*arctan(c*x)-c*d*b^2*arctan(c*x)/x-1/2*c^2*d*b^2*ln(c*x+I)*ln(c^2*x^2+1)-1/2*d*a^2/x^2

________________________________________________________________________________________

Maxima [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+I*c*d*x)*(a+b*arctan(c*x))^2/x^3,x, algorithm="maxima")

[Out]

Timed out

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \frac{8 \, x^{2}{\rm integral}\left (\frac{2 i \, a^{2} c^{3} d x^{3} + 2 \, a^{2} c^{2} d x^{2} + 2 i \, a^{2} c d x + 2 \, a^{2} d -{\left (2 \, a b c^{3} d x^{3} -{\left (2 i \, a b - 2 \, b^{2}\right )} c^{2} d x^{2} +{\left (2 \, a b - i \, b^{2}\right )} c d x - 2 i \, a b d\right )} \log \left (-\frac{c x + i}{c x - i}\right )}{2 \,{\left (c^{2} x^{5} + x^{3}\right )}}, x\right ) +{\left (2 i \, b^{2} c d x + b^{2} d\right )} \log \left (-\frac{c x + i}{c x - i}\right )^{2}}{8 \, x^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+I*c*d*x)*(a+b*arctan(c*x))^2/x^3,x, algorithm="fricas")

[Out]

1/8*(8*x^2*integral(1/2*(2*I*a^2*c^3*d*x^3 + 2*a^2*c^2*d*x^2 + 2*I*a^2*c*d*x + 2*a^2*d - (2*a*b*c^3*d*x^3 - (2
*I*a*b - 2*b^2)*c^2*d*x^2 + (2*a*b - I*b^2)*c*d*x - 2*I*a*b*d)*log(-(c*x + I)/(c*x - I)))/(c^2*x^5 + x^3), x)
+ (2*I*b^2*c*d*x + b^2*d)*log(-(c*x + I)/(c*x - I))^2)/x^2

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+I*c*d*x)*(a+b*atan(c*x))**2/x**3,x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (i \, c d x + d\right )}{\left (b \arctan \left (c x\right ) + a\right )}^{2}}{x^{3}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+I*c*d*x)*(a+b*arctan(c*x))^2/x^3,x, algorithm="giac")

[Out]

integrate((I*c*d*x + d)*(b*arctan(c*x) + a)^2/x^3, x)